<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>19-switch语句</title>
	</head>
	<body>
		<script type="text/javascript">
			/**
			  switch(表达式/值){
				  case 1:
					break;
				  case 2:
					break;
					....
				  default:
					默认值
					break;
			  }
			 */
			//星期一到星期天
			var num = prompt('请输入数字序号');
			var week = parseInt(num);
			switch(week){
				case 1:
					alert('星期一');
					break;
				case 2:
					alert('星期二');
					break;
				case 3:
					alert('星期三');
					break;
				case 4:
					alert('星期四');
					break;
				case 5:
					alert('星期五');
					break;
				case 6:
					alert('星期六');
					break;
				case 7:
					alert('星期日');
					break;
				default:
					alert('别乱输了...');
					break;
			}
			
		</script>
		
	</body>
</html>
